home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / util / cdity / ModeProSrc.lha / Prefs / MPNeuGadgets2.c < prev    next >
C/C++ Source or Header  |  2000-09-17  |  38KB  |  776 lines

  1. /*
  2.  
  3. STRPTR G_PList, G_Select_Name, G_New, G_Remove, G_Entries, G_UK_New_Entry, G_UK_Entry_Type, G_Promotion, G_Select_Screen_Mode,
  4.        G_Overscan, G_Width, G_Height, G_Colors, G_Palette, G_Color_Slider, G_Edit_Palette, G_Autoscroll, G_Interleave, G_Behind,
  5.        G_Blank_Border, G_Force_Planar, G_Center, G_3D_Look, G_3D_Default, G_3D_Reset, G_Font, G_Font_Select, G_Font_Fix_Aspect,
  6.        G_Share_Pens, G_SP_Exclude, G_Make_Public, G_Pub_Name, G_Do_Hotkey, G_Hotkey, G_Save, G_Use, G_Cancel, G_UK_Use_Delete,
  7.        G_UK_Never_Again, G_UK_Cancel;
  8.  
  9.  
  10. #include "mpp.h"
  11. #include <extras/macros/intuition.h>
  12. #include <extras/layoutgt.h>
  13. #include <clib/extras_protos.h>
  14. #include <libraries/gadtools.h>
  15. #include <intuition/gadgetclass.h>
  16.  
  17. struct LG_Control *GadControl,*PGad2GadControl;
  18. extern float XScale,YScale;
  19. struct Hook StrHook,PenLVHook,StrCursorHook,PromotionLVHook;
  20. extern UBYTE *CenterLabels[],*SFontLabels[],*OverscanLabels[],*ModeSelLabels[],*ListLabels[];
  21. extern struct TextFont *GUIFont;
  22. extern struct TextArea ColorDisp, PenNameDisp, FontDisp;
  23. extern struct Window *Win;
  24. extern struct MPMessage *ForcedEditMsg;
  25.  
  26. WORD WindowWidth=630,WindowHeight=256;  
  27.  
  28. struct IBox GadgetArea[TOTAL_AREAS];
  29. struct List OptionList;
  30.  
  31. struct LG_Control *MakeMPPGadgets(struct Window *Window, APTR VisualInfo, struct TextAttr *TA)
  32. {
  33. //  WORD MaxPGadWidth;
  34.   
  35.   LONG l,ww,wh,feditspace;
  36.   float xs;
  37. //  char colorkeys[5],*colorstr;
  38.  
  39.   /*
  40.   struct IBox ibox[]={
  41.                         {5,    4,    196,   192}, // list
  42.                         {209,  4,    234,   91},  // promm
  43.                         {209,  101,  234,   38},  // opt
  44.                         {453,  4,    171,   98},  // td
  45.                         {209,  145,  234,   51},  // font
  46.                         {453,  108,  171,   26},  // shrp
  47.                         {453,  140,  171,   25},  // pub
  48.                         {453,  171,  171,   25},  // hotk
  49.                         {5,    202,  619,   12}   // pgad
  50.                      };
  51.   */
  52.                      
  53.   struct IBox ibox[]={
  54.                         {7,    4,    194,   -25}, // list
  55.                         {212,  4,    232,   91},  // promm
  56.                         {212,  101,  232,   -179},  // opt
  57.                         {455,  4,    169,  -119},  // td
  58.                         {212,  -72,  232,   51},  // font
  59.                         {455,  -109,  169,   26},  // shrp
  60.                         {455,  -77,  169,   25},  // pub
  61.                         {455,  -46,  169,   25},  // hotk
  62.                         {7,    -15,  617,   12}   // pgad
  63.                      };
  64.   
  65.   
  66.   ww=((float)GetWinInnerWidth(Window)/XScale);
  67.   wh=((float)GetWinInnerHeight(Window)/YScale);
  68.   xs=(float)ww/(float)WindowWidth;
  69.  
  70. /*
  71.   colorstr=GetString(MSG_G_COLOR_SLIDER);
  72.  
  73.   colorkeys[0]=KeyUnshifted(colorstr[1]);
  74.   colorkeys[1]=KeyUnshifted(colorstr[0]);
  75.   colorkeys[2]=KeyShifted(colorstr[1]);
  76.   colorkeys[3]=KeyShifted(colorstr[0]);
  77.   colorkeys[4]=0;
  78.  
  79.   printf("%s - %s\n",colorstr,colorkeys);
  80. */
  81.   for(l=0;l<TOTAL_AREAS;l++)
  82.   {
  83.     GadgetArea[l].Left  =ibox[l].Left   *xs;
  84.     GadgetArea[l].Width =ibox[l].Width  *=xs;
  85.     
  86.     GadgetArea[l].Top=    (ibox[l].Top<0    ? ibox[l].Top   +=wh : ibox[l].Top);
  87.     GadgetArea[l].Height= (ibox[l].Height<0 ? ibox[l].Height+=wh : ibox[l].Height);
  88.   }
  89.  
  90.   feditspace=(GadgetArea[PGAD_AREA].Width-128)/3;
  91.  
  92.   GadControl=LG_CreateGadgets( /* init shit */
  93.                                 LG_VisualInfo           ,VisualInfo,
  94.                                 LG_UseWindowOffsets     ,Window,
  95.                                 LG_EraseRemoved         ,FALSE,
  96.                                 LG_TextAttr             ,TA,
  97.                                 LG_ScaleX               ,(ULONG)(XScale * 65535),
  98.                                 LG_ScaleY               ,(ULONG)(YScale * 65535),
  99.                                 /* List gadget offsets */
  100.                                 LG_Bounds               ,&GadgetArea[LIST_AREA],
  101.  
  102.  
  103.                                 LG_SkipGadgets          ,(ForcedEditMsg ? 7 : 0),
  104.                                 /* List type */
  105.                                 LG_LeftEdge     ,0,
  106.                                 LG_TopEdge      ,0,
  107.                                 LG_Width        ,LG_REL_WIDTH(0),
  108.                                 LG_Height       ,12,
  109.                                 LG_GadgetText   ,GetString(MSG_G_PLIST),
  110.                                 LG_GadgetID     ,GD_TYPE,
  111.                                 LG_Flags        ,PLACETEXT_LEFT,
  112.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  113.                                 LG_GadgetKind   ,CYCLE_KIND,
  114.                                 LG_GadgetTags   ,2,
  115.                                     GT_Underscore       ,'_',
  116.                                     GTCY_Labels         ,&ListLabels[0],
  117.                                 LG_CreateGadget  ,0,
  118.                                 
  119.                                 /* SELECT_NAME */
  120.                                 LG_TopEdge      ,LG_REL_BOTTOM(-12),
  121.                                 LG_GadgetText   ,GetString(MSG_G_SELECT_NAME),
  122.                                 LG_GadgetID     ,GD_SELECT_NAME,
  123.                                 LG_Flags        ,PLACETEXT_IN,
  124.                                 LG_LabelFlags   ,0,
  125.                                 LG_GadgetKind   ,BUTTON_KIND,
  126.                                 LG_GadgetTags   ,1,
  127.                                     GT_Underscore       ,'_',
  128.                                 LG_CreateGadget  ,0,
  129.                                 
  130.                                 /* New */
  131.                                 LG_HorizCells     ,2,
  132.                                 LG_RelHorizGap    ,2,                                
  133.                                 
  134.                                 LG_LeftEdge     ,LG_REL_CELL_LEFTEDGE(0),
  135.                                 LG_TopEdge      ,LG_REL_BOTTOM(-25),
  136.                                 LG_Width        ,LG_REL_CELL_WIDTH(1),
  137.                                 LG_GadgetText   ,GetString(MSG_G_NEW),
  138.                                 LG_GadgetID     ,GD_NEW,
  139.                                 LG_CreateGadget  ,0,
  140.                                 
  141.                                 /* Remove */
  142.                                 LG_LeftEdge     ,LG_REL_CELL_LEFTEDGE(1),
  143.                                 LG_GadgetText   ,GetString(MSG_G_REMOVE),
  144.                                 LG_GadgetID     ,GD_REMOVE,
  145.                                 LG_CreateGadget  ,0,
  146.  
  147.  
  148.                                 /* Entry Name */
  149.                                 LG_LeftEdge     ,0,
  150.                                 LG_TopEdge      ,LG_REL_BOTTOM(-38),
  151.                                 LG_Width        ,LG_REL_WIDTH(-18),
  152.                                 LG_GadgetText   ,0,
  153.                                 LG_GadgetID     ,GD_NAME,
  154.                                 LG_GadgetKind   ,STRING_KIND,
  155.                                 LG_GadgetTags   ,2,
  156.                                     GTIN_EditHook       ,&StrCursorHook,
  157.                                     GTST_MaxChars       ,256,
  158.                                 LG_CreateGadget  , 0,
  159.  
  160.                                 /* List */
  161.                                 LG_TopEdge      ,29,
  162.                                 LG_Height       ,LG_REL_HEIGHT(-55),
  163.                                 LG_GadgetText   ,GetString(MSG_G_ENTRIES),
  164.                                 LG_Flags        ,PLACETEXT_ABOVE,
  165.                                 LG_GadgetID     ,GD_LIST,
  166.                                 LG_GadgetKind   ,LISTVIEW_KIND,
  167.                                 LG_GadgetTags   ,5,
  168.                                     GT_Underscore       ,'_',
  169.                                     GTLV_ShowSelected   ,GD_NAME,
  170.                                     GTLV_ScrollWidth    ,(ULONG)(18 * XScale),
  171.                                     GTLV_CallBack       ,&PromotionLVHook,
  172.                                     LAYOUTA_Spacing     ,1,
  173.                                 LG_CreateGadget  ,0,
  174.  
  175.                                 /* Move */
  176.                                 LG_LeftEdge     ,LG_REL_RIGHT(-18),
  177.                                 LG_Width        ,18,
  178.                                 LG_GadgetID     ,GD_MOVE,
  179.                                 LG_GadgetKind   ,SLIDER_KIND,
  180.                                 LG_GadgetText   ,0,
  181.                                 LG_GadgetTags   ,5,
  182.                                     GT_Underscore       ,'_',
  183.                                     PGA_Freedom         ,LORIENT_VERT,
  184.                                     GTSL_Min            ,0, 
  185.                                     GTSL_Max            ,0, 
  186.                                     GTSL_Level          ,0,
  187.                                 LG_CreateGadget  ,0,
  188.                                 /* End of list gadgets */
  189.                                 
  190.                                 LG_SkipGadgets          ,(ForcedEditMsg ? 0 : 2),
  191.                                 
  192.                                 LG_LeftEdge     ,0,
  193.                                 LG_TopEdge      ,13,
  194.                                 LG_Width        ,LG_REL_WIDTH(0),
  195.                                 LG_Height       ,12,
  196.                                 LG_GadgetText   ,GetString(MSG_G_UK_NEW_ENTRY),
  197.                                 LG_GadgetID     ,GD_FE_ENTRY_NAME,
  198.                                 LG_Flags        ,PLACETEXT_ABOVE,
  199.                                 LG_GadgetKind   ,TEXT_KIND,
  200.                                 LG_GadgetTags   ,3,
  201.                                   GTTX_Border           ,1,
  202.                                   GTTX_Justification    ,GTJ_CENTER,
  203.                                   GTTX_Clipped          ,1,
  204.                                 LG_CreateGadget  ,0,
  205.                                 
  206.                                 LG_TopEdge      ,39,
  207.                                 LG_GadgetText   ,GetString(MSG_G_UK_ENTRY_TYPE),
  208.                                 LG_GadgetID     ,GD_FE_ENTRY_TYPE,
  209.                                 LG_CreateGadget  ,0,
  210.                                 
  211.                                 /* Promotion Gads */
  212.                                 LG_Bounds       ,&GadgetArea[PROM_AREA],
  213.                                 
  214.                                 /* ModeSel */
  215.                                 LG_LeftEdge     ,0,
  216.                                 LG_TopEdge      ,0,
  217.                                 LG_Width        ,LG_REL_WIDTH(0),
  218.                                 LG_Height       ,12,
  219.                                 LG_GadgetText   ,GetString(MSG_G_PROMOTION),
  220.                                 LG_GadgetID     ,GD_MODESEL,
  221.                                 LG_Flags        ,PLACETEXT_LEFT,
  222.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  223.                                 LG_GadgetKind   ,CYCLE_KIND,
  224.                                 LG_GadgetTags   ,2,
  225.                                     GT_Underscore,'_',
  226.                                     GTCY_Labels, &ModeSelLabels[0], 
  227.                                 LG_CreateGadget  ,0,
  228.  
  229.                                 /* SelMode */
  230.                                 LG_TopEdge      ,13,
  231.                                 LG_GadgetText   ,GetString(MSG_G_SELECT_SCREEN_MODE),
  232.                                 LG_GadgetID     ,GD_SELMODE,
  233.                                 LG_Flags        ,PLACETEXT_IN,
  234.                                 LG_LabelFlags   ,0,
  235.                                 LG_GadgetKind   ,BUTTON_KIND,
  236.                                 LG_GadgetTags   ,1,
  237.                                     GT_Underscore       ,'_',
  238.                                 LG_CreateGadget  ,0,
  239.  
  240.                                 /* Screen Mode */
  241.                                 LG_TopEdge      ,26,
  242.                                 LG_GadgetText   ,0,
  243.                                 LG_GadgetID     ,GD_SCREENMODE,
  244.                                 LG_GadgetKind   ,TEXT_KIND,
  245.                                 LG_GadgetTags   ,2,
  246.                                     GT_Underscore       ,'_',
  247.                                     GTTX_Border, TRUE,
  248.                                 LG_CreateGadget  ,0,
  249.                                 
  250.                                 /* Overscan */
  251.                                 LG_TopEdge      ,39,
  252.                                 LG_GadgetText   ,GetString(MSG_G_OVERSCAN),
  253.                                 LG_GadgetID     ,GD_OVERSCAN,
  254.                                 LG_Flags        ,PLACETEXT_LEFT,
  255.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  256.                                 LG_GadgetKind   ,CYCLE_KIND,
  257.                                 LG_GadgetTags   ,2,
  258.                                     GT_Underscore       ,'_',
  259.                                     GTCY_Labels, &OverscanLabels[0],
  260.                                 LG_CreateGadget  ,0,
  261.                                
  262.                                 LG_HorizCells   ,2,
  263.                                 LG_RelHorizGap  ,8,                                
  264.                                 /* Width */
  265.                                 LG_TopEdge      ,52,
  266.                                 LG_Width        ,LG_REL_CELL_WIDTH(1),
  267. //                                LG_Width        ,GadgetArea[PROM_AREA].Width/2-8,
  268.                                 LG_GadgetText   ,GetString(MSG_G_WIDTH),
  269.                                 LG_GadgetID     ,GD_WIDTH,
  270.                                 LG_GadgetKind   ,INTEGER_KIND,
  271.                                 LG_GadgetTags   ,2,
  272.                                     GT_Underscore       ,'_',
  273.                                     GTIN_MaxChars, 10,
  274.                                 LG_CreateGadget  ,0,
  275.  
  276.                                 /* Height */
  277.                                 //LG_LeftEdge     ,GadgetArea[PROM_AREA].Width/2+8,
  278.                                 LG_LeftEdge     ,LG_REL_CELL_LEFTEDGE(1),
  279.                                 LG_GadgetText   ,GetString(MSG_G_HEIGHT),
  280.                                 LG_GadgetID     ,GD_HEIGHT,
  281.                                 LG_GadgetTags   ,2,
  282.                                     GT_Underscore       ,'_',
  283.                                     GTIN_MaxChars, 10,
  284.                                 LG_CreateGadget  ,0,
  285.                                 
  286.                                 /* Do Depth */
  287.                                 LG_LeftEdge     ,0,
  288.                                 LG_TopEdge      ,66,
  289.                                 LG_Width        ,26,
  290.                                 LG_Height       ,12,
  291.                                 LG_GadgetText   ,GetString(MSG_G_COLORS),
  292.                                 LG_GadgetID     ,GD_DODEPTH,
  293.                                 LG_Flags        ,PLACETEXT_RIGHT,
  294.                                 LG_LabelFlags   ,0,
  295.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  296.                                 LG_GadgetTags   ,2,
  297.                                     GT_Underscore       ,'_',
  298.                                     GTCB_Scaled , TRUE,
  299.                                 LG_CreateGadget ,0,
  300.                                 
  301.                                 /* Palette */
  302.                                 LG_TopEdge      ,79,
  303.                                 LG_GadgetText   ,GetString(MSG_G_PALETTE),
  304.                                 LG_GadgetID     ,GD_PALETTE,
  305.                                 LG_CreateGadget ,0,
  306.                                 
  307.                                 /* Colors */
  308.                                 LG_LeftEdge     ,LG_REL_RIGHT(0),
  309.                                 LG_TopEdge      ,66,
  310.                                 LG_Width        ,LG_REL_WIDTH(-163),
  311.                                 LG_GadgetText   ,GetString(MSG_G_COLOR_SLIDER),
  312.                                 LG_GadgetID     ,GD_DEPTH,
  313.                                 LG_Flags        ,PLACETEXT_RIGHT,
  314.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  315.                                 LG_Justification,LG_JUST_RIGHT | LG_JUST_WITHLABEL,
  316.                                 LG_GadgetKind   ,SLIDER_KIND,
  317.                                 LG_KeyString    ,GetString(MSG_G_COLOR_SLIDER),
  318.                                 LG_GadgetTags   ,4,
  319.                                     GT_Underscore       ,'_',
  320.                                     PGA_Freedom         ,LORIENT_HORIZ,
  321.                                     GTSL_Min            ,1,
  322.                                     GTSL_Max            ,8,
  323.                                 LG_CreateGadget  ,0,
  324.                                 
  325.                                 /* Edit Pal */
  326.                                 LG_TopEdge      ,79,
  327.                                 LG_Width        ,LG_REL_WIDTH(-117),
  328.                                 LG_GadgetText   ,GetString(MSG_G_EDIT_PALETTE),
  329.                                 LG_GadgetID     ,GD_EDITPALETTE,
  330.                                 LG_Flags        ,PLACETEXT_IN,
  331.                                 LG_GadgetKind   ,BUTTON_KIND,
  332.                                 LG_GadgetTags   ,1,
  333.                                     GT_Underscore       ,'_',
  334.                                 LG_CreateGadget ,0,
  335.  
  336.                                 LG_Justification,0,
  337.  
  338.                                 /* Option Gads */
  339.                                 LG_Bounds       ,&GadgetArea[OPT_AREA],
  340.  
  341.                                 /* AutoScroll*/
  342.                                 LG_LeftEdge     ,0,
  343.                                 LG_TopEdge      ,0,
  344.                                 LG_Width        ,26,
  345.                                 LG_Height       ,12,
  346.                                 LG_GadgetText   ,GetString(MSG_G_AUTOSCROLL),
  347.                                 LG_GadgetID     ,GD_AUTOSCROLL,
  348.                                 LG_Flags        ,PLACETEXT_RIGHT,
  349.                                 LG_LabelFlags   ,0,
  350.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  351.                                 LG_GadgetTags   ,2,
  352.                                     GT_Underscore       ,'_',
  353.                                     GTCB_Scaled, TRUE,
  354.                                 LG_CreateGadget  ,0,
  355.                                 
  356.                                 /* Interleave */
  357.                                 LG_TopEdge      ,13,
  358.                                 //LG_LeftEdge     ,GadgetArea[OPT_AREA].Width/2,
  359.                                 LG_GadgetText   ,GetString(MSG_G_INTERLEAVE),
  360.                                 LG_GadgetID     ,GD_INTERLEAVE,
  361.                                 LG_CreateGadget  ,0,
  362.                                 
  363.                                 /* Behind */
  364.                                 LG_TopEdge      ,26,
  365.                                 //LG_LeftEdge     ,GadgetArea[OPT_AREA].Width/2,
  366.                                 LG_GadgetText   ,GetString(MSG_G_BEHIND),
  367.                                 LG_GadgetID     ,GD_BEHIND,
  368.                                 
  369.                                 LG_CreateGadget ,0,
  370.                                 
  371.                                 /* Open Blank */
  372.                                 LG_TopEdge      ,39,
  373.                                 //LG_LeftEdge     ,0,
  374.                                 LG_GadgetText   ,GetString(MSG_G_BLANK_BORDER),
  375.                                 LG_GadgetID     ,GD_BLANK_BORDER,
  376.                                 LG_CreateGadget ,0,
  377.                             
  378.                                 /* Force Planar */
  379.                                 LG_TopEdge      ,52,
  380.                                 LG_GadgetText   ,GetString(MSG_G_FORCE_PLANAR),
  381.                                 LG_GadgetID     ,GD_FORCE_PLANAR,
  382.                                 LG_CreateGadget  ,0,
  383.  
  384.                                 /* Center */
  385.                                 LG_LeftEdge     ,0,
  386.                                 LG_TopEdge      ,65,
  387.                                 LG_Width        ,LG_REL_WIDTH(0),
  388.                                 LG_GadgetText   ,GetString(MSG_G_CENTER),
  389.                                 LG_GadgetID     ,GD_CENTER,
  390.                                 LG_Flags        ,PLACETEXT_LEFT,
  391.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  392.                                 LG_GadgetKind   ,CYCLE_KIND,
  393.                                 LG_GadgetTags   ,2,
  394.                                     GT_Underscore       ,'_',
  395.                                     GTCY_Labels         ,&CenterLabels[0],
  396.                                 LG_CreateGadget  ,0,
  397.                                 /*
  398.                                 /* Options List*/
  399.                                 LG_TopEdge      ,0,
  400.                                 LG_Height       ,LG_REL_HEIGHT(-13),
  401.                                 LG_GadgetText   ,"_Options (T-oggle)",
  402.                                 LG_GadgetID     ,GD_AUTOSCROLL,
  403.                                 LG_Flags        ,PLACETEXT_ABOVE,
  404.                                 LG_GadgetKind   ,LISTVIEW_KIND,
  405.                                 LG_GadgetTags   ,3,
  406.                                   GTLV_ShowSelected     ,0,
  407.                                   GT_Underscore         ,'_',
  408.                                   GTLV_Labels           ,&OptionList,
  409.                                 LG_CreateGadget ,0,
  410.                                 */
  411.                                 /* End Opt */
  412.                                 /* Begin 3d */
  413.                                 LG_Bounds       ,&GadgetArea[TD_AREA],
  414.                                 
  415.                                 /* LOOK3D */
  416.                                 LG_LeftEdge     ,0,
  417.                                 LG_TopEdge      ,0,
  418.                                 LG_Width        ,26,
  419.                                 LG_Height       ,12,
  420.                                 LG_GadgetText   ,GetString(MSG_G_3D_LOOK),
  421.                                 LG_GadgetID     ,GD_LOOK3D,
  422.                                 LG_Flags        ,PLACETEXT_RIGHT,
  423.                                 LG_LabelFlags   ,0,
  424.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  425.                                 LG_GadgetTags   ,2,
  426.                                     GT_Underscore       ,'_',
  427.                                     GTCB_Scaled         ,TRUE,
  428.                                 LG_CreateGadget  ,0,
  429.                                 
  430.                                 LG_TopEdge      ,13,
  431.                                 LG_GadgetText   ,GetString(MSG_G_3D_DEFAULT),
  432.                                 LG_GadgetID     ,GD_3D_DEFAULT,
  433.                                 LG_CreateGadget  ,0,
  434.                                 
  435.                                 /* Reset Pens */
  436.                                 LG_TopEdge      ,26,
  437.                                 LG_Width        ,LG_REL_WIDTH(0),
  438.                                 LG_GadgetText   ,GetString(MSG_G_3D_RESET),
  439.                                 LG_GadgetID     ,GD_RESETPENS,
  440.                                 LG_Flags        ,PLACETEXT_IN,
  441.                                 LG_GadgetKind   ,BUTTON_KIND,
  442.                                 LG_GadgetTags   ,1,
  443.                                     GT_Underscore       ,'_',
  444.                                 LG_CreateGadget  ,0,
  445.                                 
  446.                                 
  447.                                 /* PenList */
  448.                                 LG_TopEdge      ,39,
  449.                                 LG_Height       ,LG_REL_HEIGHT(-52),
  450.                                 LG_GadgetText   ,0,
  451.                                 LG_GadgetID     ,GD_PENLIST,
  452.                                 LG_GadgetKind   ,LISTVIEW_KIND,
  453.                                 LG_GadgetTags   ,3,
  454.                                     GT_Underscore       ,'_',
  455.                                     GTLV_CallBack       ,&PenLVHook,
  456.                                     GTLV_ScrollWidth    ,18,
  457.                                 LG_CreateGadget  ,0,
  458.                                 
  459.                                 /* PenVal */
  460.                                 LG_LeftEdge     ,LG_REL_RIGHT(-55),
  461.                                 LG_TopEdge      ,LG_REL_BOTTOM(-13),
  462.                                 LG_Width        ,55,
  463.                                 LG_Height       ,12,
  464.                                 LG_GadgetID     ,GD_PENVAL,
  465.                                 LG_GadgetKind   ,INTEGER_KIND,
  466.                                 LG_GadgetTags   ,2,
  467.                                     GT_Underscore       ,'_',
  468.                                     GTIN_EditHook       ,&StrCursorHook,
  469.                                 LG_CreateGadget  ,0,
  470.  
  471.                                 /* Font */
  472.                                 LG_Bounds       ,&GadgetArea[FONT_AREA],
  473.                                 
  474.                                 /* Font Mode */
  475.                                 LG_LeftEdge     ,0,
  476.                                 LG_TopEdge      ,0,
  477.                                 LG_Width        ,LG_REL_WIDTH(0),
  478.                                 LG_Height       ,12,
  479.                                 LG_GadgetText   ,GetString(MSG_G_FONT),
  480.                                 LG_GadgetID     ,GD_SFONT,
  481.                                 LG_Flags        ,PLACETEXT_LEFT,
  482.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  483.                                 LG_GadgetKind   ,CYCLE_KIND,
  484.                                 LG_GadgetTags   ,2,
  485.                                     GT_Underscore       ,'_',
  486.                                     GTCY_Labels         ,&SFontLabels[0],
  487.                                 LG_CreateGadget  ,0,
  488.  
  489.                                 /* Pick font */
  490.                                 LG_TopEdge      ,13,
  491.                                 LG_GadgetText   ,GetString(MSG_G_FONT_SELECT),
  492.                                 LG_GadgetID     ,GD_PICKFONT,
  493.                                 LG_Flags        ,PLACETEXT_IN,
  494.                                 LG_LabelFlags   ,0,
  495.                                 LG_GadgetKind   ,BUTTON_KIND,
  496.                                 LG_GadgetTags   ,1,
  497.                                     GT_Underscore       ,'_',
  498.                                 LG_CreateGadget  ,0,
  499.                                 
  500.                                 /* Fix Aspect */
  501.                                 LG_TopEdge      ,39,
  502.                                 LG_Width        ,26,
  503.                                 LG_GadgetText   ,GetString(MSG_G_FONT_FIX_ASPECT),
  504.                                 LG_GadgetID     ,GD_FASPECT,
  505.                                 LG_Flags        ,PLACETEXT_RIGHT,
  506.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  507.                                 LG_GadgetTags   ,2,
  508.                                     GT_Underscore       ,'_',
  509.                                     GTCB_Scaled         ,TRUE,
  510.                                 LG_CreateGadget  ,0,
  511.                                 /* End font */
  512.                                 /* Begin Share pens */
  513.                                 LG_Bounds      ,&GadgetArea[SHPN_AREA],
  514.                                 
  515.                                 /* Share Pens */
  516.                                 LG_LeftEdge     ,0,
  517.                                 LG_TopEdge      ,0,
  518.                                 LG_Width        ,26,
  519.                                 LG_Height       ,12,
  520.                                 LG_GadgetText   ,GetString(MSG_G_SHARE_PENS),
  521.                                 LG_GadgetID     ,GD_SHAREPENS,
  522.                                 LG_Flags        ,PLACETEXT_RIGHT,
  523.                                 LG_LabelFlags   ,0,
  524.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  525.                                 LG_GadgetTags   ,2,
  526.                                     GT_Underscore       ,'_',
  527.                                     GTCB_Scaled         ,TRUE,
  528.                                 LG_CreateGadget  ,0,
  529.                                 
  530.                                 /* Exclude */
  531.                                 LG_TopEdge      ,14,
  532.                                 LG_Width        ,LG_REL_WIDTH(0),
  533.                                 LG_GadgetText   ,GetString(MSG_G_SP_EXCLUDE),
  534.                                 LG_GadgetID     ,GD_LOCKEDPENS,
  535.                                 LG_Flags        ,PLACETEXT_LEFT,
  536.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  537.                                 LG_GadgetKind   ,STRING_KIND,
  538.                                 LG_GadgetTags   ,3,
  539.                                     GT_Underscore       ,'_',
  540.                                     GTST_EditHook       ,&StrHook,
  541.                                     GTST_MaxChars       ,256,
  542.                                 LG_CreateGadget  ,0,
  543.                                 /* End share */
  544.                                 /* Begin Public */
  545.                                 LG_Bounds       ,&GadgetArea[PUB_AREA],
  546.                                 
  547.                                 /* Make Public */
  548.                                 LG_LeftEdge     ,0,
  549.                                 LG_TopEdge      ,0,
  550.                                 LG_Width        ,26,
  551.                                 LG_Height       ,12,
  552.                                 LG_GadgetText   ,GetString(MSG_G_MAKE_PUBLIC),
  553.                                 LG_GadgetID     ,GD_PUBOPT,
  554.                                 LG_Flags        ,PLACETEXT_RIGHT,
  555.                                 LG_LabelFlags   ,0,
  556.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  557.                                 LG_GadgetTags   ,2,
  558.                                     GT_Underscore       ,'_',
  559.                                     GTCB_Scaled         ,TRUE,
  560.                                 LG_CreateGadget  ,0,
  561.                                 
  562.                                 /* Pub Name */
  563.                                 LG_TopEdge      ,13,
  564.                                 LG_Width        ,LG_REL_WIDTH(0),
  565.                                 LG_GadgetText   ,GetString(MSG_G_PUB_NAME),
  566.                                 LG_GadgetID     ,GD_PUBNAME,
  567.                                 LG_Flags        ,PLACETEXT_LEFT,
  568.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  569.                                 LG_GadgetKind   ,STRING_KIND,
  570.                                 LG_GadgetTags   ,1,
  571.                                     GT_Underscore       ,'_',
  572.                                     GTST_MaxChars       ,MAXPUBSCREENNAME+1,
  573.                                 LG_CreateGadget  ,0,
  574.                                 /* End Pub */
  575.                                 /* Begin HotKey */
  576.                                 LG_Bounds       ,&GadgetArea[HOTK_AREA],
  577.                                 /* Do HotKey */
  578.                                 LG_LeftEdge     ,0,
  579.                                 LG_TopEdge      ,0,
  580.                                 LG_Width        ,26,
  581.                                 LG_Height       ,12,
  582.                                 LG_GadgetText   ,GetString(MSG_G_DO_HOTKEY),
  583.                                 LG_GadgetID     ,GD_HOTKEYOPT,
  584.                                 LG_Flags        ,PLACETEXT_RIGHT,
  585.                                 LG_LabelFlags   ,0,
  586.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  587.                                 LG_GadgetTags   ,2,
  588.                                     GT_Underscore       ,'_',
  589.                                     GTCB_Scaled         ,TRUE,
  590.                                 LG_CreateGadget  ,0,
  591.                                 
  592.                                 /* HotKey Str */
  593.                                 LG_TopEdge      ,13,
  594.                                 LG_Width        ,LG_REL_WIDTH(0),
  595.                                 LG_GadgetText   ,GetString(MSG_G_HOTKEY),
  596.                                 LG_GadgetID     ,GD_HOTKEYSTR,
  597.                                 LG_Flags        ,PLACETEXT_LEFT,
  598.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  599.                                 LG_GadgetKind   ,STRING_KIND,
  600.                                 LG_GadgetTags   ,1,
  601.                                     GT_Underscore       ,'_',
  602.                                 LG_CreateGadget  ,0,
  603.                                 /* End HK */
  604.                                 
  605.                                 /* Begin SUC */
  606.                                 LG_Bounds       ,&GadgetArea[PGAD_AREA],
  607.                                 
  608.                                 LG_SkipGadgets ,(ForcedEditMsg?3:0),
  609.                                 
  610.                                 /* Save */
  611.                                 LG_LeftEdge     ,0,
  612.                                 LG_TopEdge      ,0,
  613.                                 LG_Width        ,87,
  614.                                 LG_Height       ,12,
  615.                                 LG_GadgetText   ,GetString(MSG_G_SAVE),
  616.                                 LG_GadgetID     ,GD_SAVE,
  617.                                 LG_Flags        ,PLACETEXT_IN,
  618.                                 LG_LabelFlags   ,0,
  619.                                 LG_GadgetKind   ,BUTTON_KIND,
  620.                                 LG_CreateGadget  ,0,
  621.                                 
  622.                                 /* Use */
  623.                                 LG_LeftEdge     ,GadgetArea[PGAD_AREA].Width/2,
  624.                                 LG_GadgetText   ,GetString(MSG_G_USE),
  625.                                 LG_GadgetID     ,GD_USE,
  626.                                 LG_Justification,LG_JUST_HCENTER,
  627.                                 LG_CreateGadget  ,0,
  628.                                 
  629.                                 /* Cancel */
  630.                                 LG_LeftEdge     ,LG_REL_RIGHT(-87),
  631.                                 LG_GadgetText   ,GetString(MSG_G_CANCEL),
  632.                                 LG_GadgetID     ,GD_CANCEL,
  633.                                 LG_Justification,LG_JUST_LEFT,
  634.                                 LG_CreateGadget  ,0,
  635.                                 
  636.                                 LG_SkipGadgets ,(ForcedEditMsg?0:4),
  637.                                 
  638.                                 /* */
  639.                                 LG_Justification,LG_JUST_LEFT,
  640.                                 LG_LeftEdge     ,0,
  641.                                 LG_TopEdge      ,0,
  642.                                 LG_Width        ,128,
  643.                                 LG_Height       ,12,
  644.                                 LG_GadgetText   ,GetString(MSG_G_UK_USE),
  645.                                 LG_GadgetID     ,GD_FE_SAVEUSE,
  646.                                 LG_Flags        ,PLACETEXT_IN,
  647.                                 LG_LabelFlags   ,0,
  648.                                 LG_GadgetKind   ,BUTTON_KIND,
  649.                                 LG_CreateGadget  ,0,
  650.                                 
  651.                                 /* Use */
  652.                                 LG_LeftEdge      ,feditspace * 1,
  653.                                 LG_GadgetText    ,GetString(MSG_G_UK_USE_DELETE),
  654.                                 LG_GadgetID      ,GD_FE_USEDELETE,
  655.                                 LG_CreateGadget  ,0,
  656.                                 
  657.                                 /* Cancel */
  658.                                 LG_LeftEdge      ,feditspace * 2,
  659.                                 LG_GadgetText    ,GetString(MSG_G_UK_NEVER_AGAIN),
  660.                                 LG_GadgetID      ,GD_FE_NEVER,
  661.                                 LG_CreateGadget  ,0,
  662.                                 
  663.                                 /* Cancel */
  664.                                 LG_LeftEdge      ,feditspace * 3,
  665.                                 LG_GadgetText    ,GetString(MSG_G_UK_CANCEL),
  666.                                 LG_GadgetID      ,GD_FE_CANCEL,
  667.                                 LG_CreateGadget  ,0,
  668.                                 
  669.                                 
  670.                                 TAG_DONE);
  671. //  printf("GadControl=%8x\n",GadControl);
  672.  
  673.   ColorDisp.LeftEdge  =GadgetArea[PROM_AREA].Left+106;
  674.   ColorDisp.TopEdge   =GadgetArea[PROM_AREA].Top+66;
  675.   ColorDisp.Width     =49;
  676.   ColorDisp.Height    =12;
  677.  
  678.   PenNameDisp.LeftEdge  =GadgetArea[TD_AREA].Left;
  679.   PenNameDisp.TopEdge   =GadgetArea[TD_AREA].Top+GadgetArea[TD_AREA].Height-13;
  680.   PenNameDisp.Width     =GadgetArea[TD_AREA].Width-61;
  681.   PenNameDisp.Height    =12;
  682.  
  683.   FontDisp.LeftEdge  =GadgetArea[FONT_AREA].Left;
  684.   FontDisp.TopEdge   =GadgetArea[FONT_AREA].Top+26;
  685.   FontDisp.Width     =GadgetArea[FONT_AREA].Width;
  686.   FontDisp.Height    =12;
  687.  
  688.   SetupTextArea(&ColorDisp);
  689.   SetupTextArea(&PenNameDisp);
  690.   SetupTextArea(&FontDisp);
  691.  
  692.   return(GadControl);
  693. }
  694.  
  695. void FreeMPPGadgets(void)
  696. {
  697.   LG_FreeGadgets(GadControl);
  698.   GadControl=0;
  699. }
  700.  
  701. void SetupTextArea(struct TextArea *TA)
  702. {
  703.   TA->LeftEdge   = TA->LeftEdge * XScale+Win->BorderLeft;
  704.   TA->Width      *= XScale;
  705.   TA->TopEdge    = TA->TopEdge  * YScale+Win->BorderTop;
  706.   TA->Height     *= YScale;
  707.   TA->RightEdge   = TA->Width  + TA->LeftEdge;
  708.   TA->BottomEdge  = TA->Height + TA->TopEdge;
  709.  
  710.   TA->Baseline=(TA->BottomEdge - TA->TopEdge - GUIFont->tf_YSize)/2 
  711.                       + GUIFont->tf_Baseline + TA->TopEdge;
  712. }
  713.  
  714.  
  715. BOOL GadgetInit(void)
  716. {
  717.   /*
  718.   struct Node *n;
  719.   STRPTR optname;
  720.   ULONG l;
  721.  
  722.   struct OItem
  723.   {
  724.     ULONG NameID;
  725.     BYTE FlagBit;
  726.   } oi[]=
  727.     {
  728.     { MSG_G_AUTOSCROLL,     2},
  729.     { MSG_G_BLANK_BORDER,  3},
  730.     { MSG_G_BEHIND,         4},
  731.     { MSG_G_FORCE_PLANAR,   5},
  732.     { MSG_G_INTERLEAVE,     6},
  733.     { -1,-1}
  734.     };
  735.  
  736.   NewList(&OptionList);
  737.   
  738.   for(l=0;oi[l].NameID!=-1;l++)
  739.   {
  740.     if(n=AllocVec(sizeof(struct Node),MEMF_PUBLIC))
  741.     {
  742.       optname=GetString(oi[l].NameID);
  743.       if(n->ln_Name=AllocVec(strlen(optname)+2,MEMF_PUBLIC))
  744.       {
  745.         n->ln_Name[0]=' ';
  746.         n->ln_Pri=oi[l].FlagBit;
  747.         strcpy(&n->ln_Name[1],optname);
  748.         EnqueueName(&OptionList,n);
  749.       }
  750.       else
  751.       {
  752.         FreeVec(n);
  753.       }
  754.     }
  755.   }
  756.   */
  757.   return(1);
  758. }
  759.  
  760. void GadgetCleanup(void)
  761. {
  762.   /*
  763.   struct Node *n;
  764.   
  765.   while(n=RemHead(&OptionList))
  766.   {
  767.     FreeVec(n->ln_Name);
  768.     FreeVec(n);
  769.   }
  770.   */
  771. }
  772.  
  773.  
  774.  
  775.  
  776. */